<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Forpastime < forpastime@qq.com>
// +----------------------------------------------------------------------
namespace app\tenant\model;

use think\db\Query;
use think\Model;
use tree\Tree;
/**
 * 商户入驻信息
 */
class TenantBusinessModel extends Model{

    protected $name = 'tenant_business_scope';
    
    public function getList($keywords)
    {
        $list = $this->where(function (Query $query) use ($keywords){
            if($keywords){
                $query->where('name', 'like', "%$keywords%");
            }
        })
        ->order('id desc')
        ->paginate(10);
        $list->appends(['name'=>$keywords]);

        return $list;
    }

    public function getOne($id)
    {
        $shop = $this->where('id',$id)->find();

        return $shop;
    }
}